package tech.aistar.corejava.day03;

/**
 * Created by 李雨昂 on 2019/7/20.
 */
public class ArrayDemo3 {
    public static void main(String[] args) {

        change(10,20);
        System.out.println("=============");


        int[] arr1 =  new int []{1,2};
        int[] arr2 =  new int []{3,4};

        add(arr1,arr2);
        System.out.println("arr1"+arr1[0]);
        System.out.println("arr2"+arr2[0]);
    }

    public static void change(int a, int b) {
        if(a > b){
            a = a ^ b;
            b = a ^ b;
            a = a ^ b;
        }

        System.out.println("a = " + a);
        System.out.println("b = " + b);
    }

    public static void add(int[] arr1,int[] arr2){
        arr2 = arr1;
        arr1[0]=100;
        System.out.println("arr1 = " + arr1[0]);
        System.out.println("arr2 = " + arr2[0]);
    }

}
